/**
 *                            License
 * THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS  
 * CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). 
 * THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW.  
 * ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR  
 * COPYRIGHT LAW IS PROHIBITED.
 * 
 * BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND  
 * AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE  
 * MAY BE CONSIDERED TO BE A CONTRACT,
 * THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED 
 * HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
 * 
 */
package lineage.ui.function.window.main;

/**
 * 聊天框的状态控制.
 * 
 * @version 2014年2月21日下午1:53:29
 * @author jrwz
 */
public final class L1BoxChatStatus {
    /** 系统信息框. */
    public static final int SYSTEM_MESSAGE = 1;
    /** 全体聊天框. */
    public static final int ALL_CHAT = 2;
    /** 血盟聊天框. */
    public static final int CLAN_CHAT = 3;
    /** 组队聊天框. */
    public static final int PARTY_CHAT = 4;
    /** 秘语聊天框. */
    public static final int PRIVATE_CHAT = 5;
    /** 一般聊天框. */
    public static final int GENERAL_CHAT = 6;

    /**
     * 由按钮控制的聊天框显示状态(显示-隐藏).
     * 
     * @param type
     *            - 聊天框类型
     */
    public static void buttonChange(int type) {
        boolean SystemMessageStatus = false;
        boolean AllChatStatus = false;
        boolean ClanChatStatus = false;
        boolean PartyChatStatus = false;
        boolean PrivateChatStatus = false;
        boolean GeneralChatStatus = false;
        // 切换按钮状态
        boolean SystemButtonStatus = true;
        boolean AllButtonStatus = true;
        boolean ClanButtonStatus = true;
        boolean PartyButtonStatus = true;
        boolean PrivateButtonStatus = true;
        boolean GeneralButtonStatus = true;
        switch (type) {
        case SYSTEM_MESSAGE:
            SystemMessageStatus = true;
            SystemButtonStatus = false;
            break;
        case ALL_CHAT:
            AllChatStatus = true;
            AllButtonStatus = false;
            break;
        case CLAN_CHAT:
            ClanChatStatus = true;
            ClanButtonStatus = false;
            break;
        case PARTY_CHAT:
            PartyChatStatus = true;
            PartyButtonStatus = false;
            break;
        case PRIVATE_CHAT:
            PrivateChatStatus = true;
            PrivateButtonStatus = false;
            break;
        case GENERAL_CHAT:
            GeneralChatStatus = true;
            GeneralButtonStatus = false;
            break;
        default:
            break;
        }
        L1BoxSystemMessage.getInstance().setShow(SystemMessageStatus); // 系统信息框
        L1BoxChatAll.getInstance().setShow(AllChatStatus); // 全体聊天框
        L1BoxChatClan.getInstance().setShow(ClanChatStatus); // 血盟聊天框
        L1BoxChatParty.getInstance().setShow(PartyChatStatus); // 组队聊天框
        L1BoxChatSecret.getInstance().setShow(PrivateChatStatus); // 秘语聊天框
        L1BoxChatGeneral.getInstance().setShow(GeneralChatStatus); // 一般聊天框

        // 按钮
        L1ButtonBoxSystemMessage.getInstance().setEnabled(SystemButtonStatus);
        L1ButtonBoxChatAll.getInstance().setEnabled(AllButtonStatus);
        L1ButtonBoxChatClan.getInstance().setEnabled(ClanButtonStatus);
        L1ButtonBoxChatParty.getInstance().setEnabled(PartyButtonStatus);
        L1ButtonBoxChatSecret.getInstance().setEnabled(PrivateButtonStatus);
        L1ButtonBoxChatGeneral.getInstance().setEnabled(GeneralButtonStatus);
    }
}
